package com.hspedu.homework;

/**
 * @Author Stringzhua
 * @Date 2024/3/7 14:22
 * description:
 */
public class homework01 {
    public static void main(String[] args) {
        Car c = new Car();
        Car c1 = new Car(100);
        System.out.println("c = " + c); //c=9.0 red
        System.out.println("c1 = " + c1);//c1=100.0 red
    }
}

class Car {
    double price = 10;
    static String color = "white";

    @Override
    public String toString() {
        return price + "\t" + color;
    }

    public Car() {
        this.price = 9;
        this.color = "red";
    }

    public Car(double price) {
        this.price = price;
    }
}
